package com.lizhen.core.datastructure;

import java.util.Iterator;
import java.util.Properties;
import java.util.Set;

public class PropertiesDataStructure {
    public static void main(String[] args) {
        Properties properties = new Properties();
        properties.put("Illinois", "Springfield");
        properties.put("Missouri", "Jefferson City");
        properties.put("Washington", "Olympia");
        properties.put("California", "Sacramento");
        properties.put("Indiana", "Indianapolis");
        Set<Object> set = properties.keySet();
        Iterator<Object> iterator_ = set.iterator();
        String property = properties.getProperty("Florida", "Not Found");


        while (iterator_.hasNext()) {
            String str = (String) iterator_.next();

            System.out.println("The capital of " + str + " is " + properties.getProperty(str) + ".");
        }
        System.out.println("The capital of Florida is " + property + ".");
    }
}
